package interfazgrafikoak;

import javax.swing.*;

import java.awt.*;
import java.util.Vector;

public class Erraza extends JFrame {


	private static final long serialVersionUID = 1L;

	public Erraza(){
		super("Beste proba bat");
	}	
	
	public void go(){
		
		Button aButton = new Button("Ezabatu");
		JTextArea jTextArea1 = new JTextArea();
		JPanel jPanel2 = new JPanel();
		
	// Aukera botoiak sortu
		JRadioButton goizez = new JRadioButton("Goizez",true);
		JRadioButton arratsaldez = new JRadioButton("Arratsaldez",false);
				
	// Aukera botoi multzoa sortu, aukera botoiak elkartzeko
		ButtonGroup aukeraBotoiMultzoa = new ButtonGroup();
		aukeraBotoiMultzoa.add(goizez);
		aukeraBotoiMultzoa.add(arratsaldez);
		
	// Aukera zerrenda sortu eta aukeraz elikatu
		Vector<String> astegunak = new Vector<String>();
		JComboBox jComboBox1 = new JComboBox(astegunak);
		
		 astegunak.addElement("Astelehena");
		 astegunak.addElement("Asteartea");    
		 astegunak.addElement("Asteazkena");
		 astegunak.addElement("osteguna");
		 astegunak.addElement("Ostirala");		
		
      //  osagaiak panelan sartu
		 
		 jPanel2.add(BorderLayout.CENTER, goizez);
		 jPanel2.add(BorderLayout.CENTER, arratsaldez);
		 jPanel2.add(BorderLayout.CENTER, jComboBox1);
		 
		JPanel barrukoPanela = (JPanel) this.getContentPane();
		
		barrukoPanela.add(BorderLayout.NORTH, jPanel2);
		barrukoPanela.add(BorderLayout.CENTER, jTextArea1);
		barrukoPanela.add(BorderLayout.SOUTH, aButton);
				 
	// Framean sartu goi-mailako panela, testu-area eta botoia
		this.setSize(320,200);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
		
	}
	
	public static void main(String[] args){
		Erraza proba = new Erraza();
		proba.go();
	}
}
